package com.example.javafx.bilibilidownload.constant;

public class VideoConstant {

    public static int biliDownloadThreadPoolSize = 6;

    public static String absolutePath = "/Volumes/xj1T/MyProject/bilibili/";
    boolean checkFfmpeg = false;

    private static String windowsTempPath = "bilibiliDownloadTemp";

    private static String windowsTargetPath = "bilibiliDownload";

    private static String macTempPath = "bilibiliDownloadTemp";

    private static String macTargetPath = "bilibiliDownload";

    /**
     * ffmpeg命令
     */
    private static String windowsFFMPEG = "D:\\ffmpeg\\bin\\ffmpeg";

    /**
     * ffmpeg执行文件的安装位置
     */
    private static String macFFMPEG = "/Users/bang/Documents/ffmpeg";


    public static String getTempPath() {
        if (isWindows()) {
            return windowsTempPath;
        } else {
            return macTempPath;
        }
    }

    public static void main(String[] args) {
        System.out.println(isWindows());
    }

    public static boolean isWindows() {
        if (System.getProperty("os.name").contains("Windows")) {
            return true;
        }
        return false;
    }

    public static String getTargetPath() {
        if (isWindows()) {
            return windowsTargetPath;
        } else {
            return macTargetPath;
        }
    }

    public static String getFFMPEGPath() {
        if (isWindows()) {
            return windowsFFMPEG;
        } else {
            return macFFMPEG;
        }
    }

    /**
     * 默认video的template
     */
    String DEFAULT_VIDEO_TEMPLATE = "video_hls_normal";

    /**
     * 默认CRF值：用于视觉无损视频质量
     */
    int DEFAULT_CRF = 18;

    /**
     * qt-faststart命令
     */
    public static String QT_FASTSTART = "qt-faststart";

    /**
     * 默认缩略图时间间隔（s）
     */
    int DEFAULT_THUMBNAIL_TIME_INTERVAL = 10;

    /**
     * 是否分离音频：是
     */
    String AUDIO_SPLIT_YES = "1";

    /**
     * 默认gif时长
     */
    int DEFAULT_GIF_TIME = 3;

    /**
     * 默认超时时长,单位微秒
     */
    String DEFAULT_TIMEOUT_TIME = "300000000";

}
